(function() {
  var Session, TomatoBreak;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  };
  TomatoBreak = this.TomatoBreak;
  Session = (function() {
    __extends(Session, Spine.Model);
    function Session() {
      Session.__super__.constructor.apply(this, arguments);
    }
    Session.configure('Session', 'emailOrUserName', 'password', 'rememberMe');
    Session.extend(Spine.Model.Ajax);
    Session.extend({
      url: function() {
        return 'session';
      }
    });
    Session.prototype.validate = function() {
      var addError, errors;
      errors = [];
      addError = function(name, message) {
        var error;
        error = {
          name: name,
          messages: []
        };
        error.messages.push(message);
        return errors.push(error);
      };
      if (!this.emailOrUserName) {
        addError('emailOrUserName', 'Email or User name cannot be blank.');
      }
      if (!this.password) {
        addError('password', 'Password cannot be blank.');
      }
      if (errors.length) {
        return errors;
      }
    };
    return Session;
  })();
  TomatoBreak.Session = Session;
}).call(this);
